home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / littlest / littl-st.lha / stdwin.h < prev    next >
C/C++ Source or Header  |  1993-08-10  |  5KB  |  148 lines

  1. /* GENERIC STDWIN -- INTERFACE HEADER FILE. */
  2.  
  3. #ifndef GENERIC_STDWIN
  4.  
  5. #define GENERIC_STDWIN
  6.     /* So this header file is skipped if included twice */
  7.  
  8. #define CURSOR_CARET
  9.     /* Defined so textedit will always set the caret at the start of
  10.        the focus -- useful only for ASCII terminals. */
  11.  
  12. #ifndef ARGS
  13. #define ARGS(x) ()    /* replace by x for ANSI C */
  14. #endif
  15.  
  16. #ifndef NOARGS
  17. #define NOARGS ()    /* replace by (void) for ANSI C */
  18. #endif
  19.  
  20. #ifndef bool
  21. #define bool int
  22. #endif
  23.  
  24. void winit NOARGS;
  25. void winitnew ARGS((int *pargc, char ***pargv));
  26. void wdone NOARGS;
  27.  
  28. void wgetscrsize ARGS((int *pwidth, int *pheight));
  29. void wgetscrmm ARGS((int *pmmwidth, int *pmmheight));
  30.  
  31. void wsetmaxwinsize ARGS((int width, int height));
  32. void wsetdefwinsize ARGS((int width, int height));
  33. void wsetdefwinpos ARGS((int h, int v));
  34.  
  35. #define MENU struct menu
  36.  
  37. /* The contents of a text attributes struct are disclosed here because
  38.    the interface allows the programmer to declare objects of this type.
  39.    (I'm not so sure anymore that this is the right thing to do!) */
  40.  
  41. struct textattr {
  42.     short font;
  43.     unsigned char size;
  44.     unsigned char style;
  45. };
  46.  
  47. #define TEXTATTR struct textattr
  48.  
  49. #ifndef WINDOW
  50.  
  51. struct window {
  52.     short tag;
  53. };
  54.  
  55. #define WINDOW struct window
  56.  
  57. #endif
  58.  
  59. WINDOW *wopen ARGS((char *title,
  60.         void (*drawproc)(/*WINDOW *win,
  61.                 int left, int top, int right, int bottom*/)));
  62. void wclose ARGS((WINDOW *win));
  63. #define wgettag(win) ((win)->tag)
  64. #define wsettag(win, newtag) ((win)->tag= newtag)
  65. void wsetactive ARGS((WINDOW *win));
  66. WINDOW *wgetactive NOARGS;
  67. void wgetwinsize ARGS((WINDOW *win, int *width, int *height));
  68. void wsetdocsize ARGS((WINDOW *win, int width, int height));
  69. void wsettitle ARGS((WINDOW *win, char *title));
  70.  
  71. void wsetorigin ARGS((WINDOW *win, int h, int v));
  72. void wshow ARGS((WINDOW *win, int left, int top, int right, int bottom));
  73. void wchange ARGS((WINDOW *win, int left, int top, int right, int bottom));
  74. void wscroll ARGS((WINDOW *win, int left, int top, int right, int bottom,
  75.     int dh, int dv));
  76.  
  77. void wfleep NOARGS;
  78. void wmessage ARGS((char *str));
  79. void wperror ARGS((char *name));
  80. bool waskstr ARGS((char *prompt, char *buf, int buflen));
  81. int waskync ARGS((char *question, int dflt));
  82. bool waskfile ARGS((char *prompt, char *buf, int buflen, bool newfile));
  83.  
  84. void wsetcaret ARGS((WINDOW *win, int h, int v));
  85. void wnocaret ARGS((WINDOW *win));
  86.  
  87. void wsettimer ARGS((WINDOW *win, int deciseconds));
  88.  
  89. MENU *wmenucreate ARGS((int id, char *title));
  90. void wmenudelete ARGS((MENU *mp));
  91. int wmenuadditem ARGS((MENU *mp, char *text, int shortcut));
  92. void wmenusetitem ARGS((MENU *mp, int i, char *text));
  93. void wmenusetdeflocal ARGS((bool local));
  94. void wmenuattach ARGS((WINDOW *win, MENU *mp));
  95. void wmenudetach ARGS((WINDOW *win, MENU *mp));
  96. void wmenuenable ARGS((MENU *mp, int item, int flag));
  97. void wmenucheck ARGS((MENU *mp, int item, int flag));
  98.  
  99. /* The following is only available in termcap stdwin: */
  100. void wsetshortcut ARGS((int id, int item, char *keys));
  101.  
  102. #include "stdevent.h"
  103.  
  104. void wgetevent ARGS((EVENT *ep));
  105. void wungetevent ARGS((EVENT *ep));
  106. void wupdate ARGS((WINDOW *win));
  107. void wbegindrawing ARGS((WINDOW *win));
  108. void wenddrawing ARGS((WINDOW *win));
  109. void wflush NOARGS;
  110.  
  111. void wdrawline ARGS((int h1, int v1, int h2, int v2));
  112. void wxorline ARGS((int h1, int v1, int h2, int v2));
  113. void wdrawcircle ARGS((int h, int v, int radius));
  114. void wdrawelarc ARGS((int h, int v, int hrad, int vrad, int ang1, int ang2));
  115. void wdrawbox ARGS((int left, int top, int right, int bottom));
  116. void werase ARGS((int left, int top, int right, int bottom));
  117. void wpaint ARGS((int left, int top, int right, int bottom));
  118. void winvert ARGS((int left, int top, int right, int bottom));
  119. void wshade ARGS((int left, int top, int right, int bottom, int percent));
  120.  
  121. int wdrawtext ARGS((int h, int v, char *str, int len));
  122. int wdrawchar ARGS((int h, int v, int c));
  123. int wlineheight NOARGS;
  124. int wbaseline NOARGS;
  125. int wtextwidth ARGS((char *str, int len));
  126. int wcharwidth ARGS((int c));
  127. int wtextbreak ARGS((char *str, int len, int width));
  128.  
  129. void wgettextattr ARGS((TEXTATTR *attr));
  130. void wsettextattr ARGS((TEXTATTR *attr));
  131. void wgetwintextattr ARGS((WINDOW *win, TEXTATTR *attr));
  132. void wsetwintextattr ARGS((WINDOW *win, TEXTATTR *attr));
  133.  
  134. void wsetplain NOARGS;
  135. void wsethilite NOARGS;
  136. void wsetinverse NOARGS;
  137. void wsetitalic NOARGS;
  138. void wsetbold NOARGS;
  139. void wsetbolditalic NOARGS;
  140. void wsetunderline NOARGS;
  141.  
  142. void wsetfont ARGS((char *fontname));
  143. void wsetsize ARGS((int pointsize));
  144.  
  145. #include "stdtext.h"
  146.  
  147. #endif /* GENERIC_STDWIN */
  148.